package chapter10

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/12 21:39
  * @history:
  *          1.2019/1/12 created by chuhaitao
  */
object ImplictDemo2 {

  def main(args: Array[String]): Unit = {

    //默认值和隐式值的优先级
    //1、隐式值优先
    //2、如果匹配不到隐式值，使用默认值
    //3、既没有隐式值，也没有默认值，也没有传值，报错
   // implicit var str: String = "test"

    def hello(implicit name: String = "jack"): Unit = {

      println(name)
    }

    hello
  }
}
